package com.flyee.utils.load
{
	import com.flyee.utils.load.contorl.LoaderManager;
	import com.flyee.utils.load.model.LoaderModel;
	
	public class StackLoader
	{
		private static var count:uint = 0;
		public function StackLoader()
		{
		}
		public function load(loadURL:String,loadLv:uint,progressHandle:Function,completeHandle:Function,returnType:String,memo:Object):int
		{
			count++;
			var tempLoader:LoaderModel = new LoaderModel();
			tempLoader.loadID = count;
			tempLoader.loadURL = loadURL;
			tempLoader.loadLevel = loadLv;
			tempLoader.loadProgressFun = progressHandle;
			tempLoader.loadReturnFun = completeHandle;
			tempLoader.returnType = returnType;
			tempLoader.memo = memo;
			LoaderManager.getInstance().addLoad(tempLoader);
			return count;
		}
		public function removeLoad(loadID:uint):void
		{
			LoaderManager.getInstance().removeLoader(loadID);
		}
		public function clear():void
		{
			LoaderManager.getInstance().clear();
		}
	}
}